package vip.mall.modular.goods.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import vip.mall.modular.goods.entity.Goods;

import java.util.List;

/**
 * @author:ASUS
 * @date:2025/2/10 10:33
 */

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {

    @Select("SELECT * FROM sys_goods LIMIT #{offset}, #{limit}")
    List<Goods> findAllWithPagination(@Param("offset") int offset, @Param("limit") int limit);

    @Select("SELECT COUNT(*) FROM sys_goods")
    int countTotalRecords();
}
